package 符串压缩;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        StringBuilder str = new StringBuilder();
        char[] ch = in.next().toCharArray();
        int n = ch.length, i = 0, j = 0;
        while (j < n) {
            while (j < n && ch[i] == ch[j]) {
                j++;
            }
            str.append(j - i);
            str.append(ch[i]);
            i = j;
        }
        System.out.println(str);
    }
}
